package com.st.qdmall.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.st.qdmall.dao.GoodsDao;
import com.st.qdmall.entity.Goods;
import com.st.qdmall.service.IGoodsService;

@Service
public class GoodsServiceImpl implements IGoodsService{

	@Autowired
	private GoodsDao goodsDao;
	
	@Override
	public int add(Goods goods) {
		return goodsDao.insert(goods);
	}

	@Override
	public List<Goods> getAll() {
		return goodsDao.selectAll();
	}

	@Override
	public int delete(Integer id) {
		return goodsDao.delete(id);
	}

	@Override
	public Goods getById(Integer id) {
		return goodsDao.selectById(id);
	}

	@Override
	public int edit(Goods goods) {
		return goodsDao.update(goods);
	}
	
	

}
